package com.itheima.controller;

import com.itheima.pojo.Result;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 异常处理方案的理解
 */
//@RestController
@RequestMapping("/users")
public class UserController {

    @Autowired
    private UserService userService;

    @GetMapping
    public Result save() {
        //try {
            userService.save();
        //} catch (Exception e) {
            //System.out.println(e.getMessage());
        //}
        return Result.success();
    }

}
